{eval
    function register_template() {
        $id = L.random(4);
        global $_G;
        $setting = $_G['setting'];
        $bbrulehash = substr(md5(FORMHASH), 0, 8);
        $dreferer = dreferer();
        $params = get_params();
        $site_url  = get_site_url();
        $invite = getinvite();
        $static_path  = rtrim($_G['siteurl'], '/').'/source/plugin/phone_auth/static';
}
<!--{block return}-->
{if $_GET['action'] == 'activation' }
<style>#registerform{display: block}</style>
<script src="{$static_path}/js/v-helper.min.js?v=$params['version']" async></script>
<script>
    (function () {
        if(window.v_helper) {
            new v_helper({
                'site_url': '{$site_url}'
            }).activation();
        }
    })()
</script>
{else}
<div id="registerphone_$id"  class="dz-register">
    <input type="hidden" name="regsubmit" value="yes" />
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <input type="hidden" name="referer" value="$dreferer" />
    <input type="hidden" name="activationauth" value="{if $_GET[action] == 'activation'}$activationauth{/if}" />
    <!--{if $setting['sendregisterurl']}-->
        <input type="hidden" name="hash" value="$_GET[hash]" />
    <!--{/if}-->
    <div class="content">
        <!--{if $invite}-->
            <!--{if $invite['uid']}-->
            <div class="dz-item-group">
                <span class="dz-intro">&#25512;&#33616;&#20154;:</span>
                <a class="dz-link"  href="home.php?mod=space&uid=$invite[uid]" target="_blank">$invite[username]</a>
            </div>
            <div class="v-line"></div>
            <!--{else}-->
            <div class="dz-item-group">
                <span class="dz-intro">&#36992;&#35831;&#30721;:</span>
                <input class="form-control dz-input" type="text" name="invitecode">
                <span class="dz-title">$_G['setting'][inviteconfig][invitecodeprompt]</span>
            </div>
            <div class="v-line"></div>
            
            <!--{/if}-->
        <!--{/if}-->
        <!--{if empty($invite) && $_G['setting']['regstatus'] == 2 && !$invitestatus}-->
        <div class="dz-item-group">
            <span class="dz-intro"><sup>*</sup>&#36992;&#35831;&#30721;:</span>
            <input class="form-control dz-input" type="text" name="invitecode">
            <span class="dz-title">
                    <!--{if $_G['setting']['inviteconfig']['buyinvitecode'] && $_G['setting']['inviteconfig']['invitecodeprice'] && ($_G['setting'][ec_tenpay_bargainor] || $_G['setting'][ec_tenpay_opentrans_chnid] || $_G['setting'][ec_account])}-->
                    <a href="misc.php?mod=buyinvitecode" target="_blank" class="dz-link">&#36824;&#27809;&#26377;&#36992;&#35831;&#30721;&#65311;&#28857;&#20987;&#27492;&#22788;&#33719;&#21462;</a>
                    <!--{/if}-->
                    $_G['setting'][inviteconfig][invitecodeprompt]
            </span>
        </div>
        <div class="v-line"></div>

        <!--{/if}-->
        <!--{if empty($invite) && $_G['setting']['regstatus'] == 3}-->
        <div class="dz-item-group">
            <span class="dz-intro">&#36992;&#35831;&#30721;:</span>
            <input class="form-control dz-input" type="text" name="invitecode">
            <span class="dz-title">$_G['setting'][inviteconfig][invitecodeprompt]</span>
        </div>
        <div class="v-line"></div>

        <!--{/if}-->
        <div class="dz-item-group">
            <span class="dz-intro"><sup>*</sup>{lang username}:</span>
            <input class="form-control dz-input" type="text" name="username">
            <span class="dz-title">{lang phone_auth:username_rule}</span>
        </div>
        <div class="v-line"></div>
        <!--{if $params['register_email'] == '1'}-->
        <div class="dz-item-group">
            <span class="dz-intro"><sup>*</sup>{lang phone_auth:email}:</span>
            <input class="form-control dz-input" type="text" name="email">
            <span class="dz-title">{lang phone_auth:email_rule}</span>
        </div>
        <div class="v-line"></div>
        <!--{/if}-->
        <div class="dz-item-group">
            <span class="dz-intro"><sup>*</sup>{lang panel_login_password}:</span>
            <input class="form-control dz-input" type="password" name="password" >
            <span class="dz-title">{lang phone_auth:password_rule}</span>
            <div class="pw-strength">
                    <div class="pw-bar"></div>
                    <div class="pw-bar-on"></div>
                    <div class="pw-separate">
                        <span></span>
                        <span></span>
                        <span></span>
                        <span></span>
                        <span></span>
                    </div>
                </div>
        </div>
        <div class="v-line"></div>
        <!--{if $_G['setting']['regverify'] == 2}-->
        <div class="dz-item-group">
            <span class="dz-intro"><sup>*</sup>&#27880;&#20876;&#21407;&#22240;:</span>
            <input class="form-control dz-input" type="text" name="regmessage">
            <span class="dz-title">&#24744;&#22635;&#20889;&#30340;&#27880;&#20876;&#21407;&#22240;&#20250;&#34987;&#24403;&#20316;&#30003;&#35831;&#27880;&#20876;&#30340;&#37325;&#35201;&#21442;&#32771;&#20381;&#25454;&#65292;&#35831;&#35748;&#30495;&#22635;&#20889;&#12290;</span>
        </div>
        <div class="v-line"></div>
        <!--{/if}-->
        {if $params['enable_inter'] == '0'}
        <div class="dz-item-group">
            <input type="hidden" value="86" name="country_code">
            <span class="dz-intro"><sup>*</sup>{lang phone_auth:phone}:</span>
            <input maxlength="11"  class="form-control dz-input" name="phone">
            <span class="dz-title"></span>
        </div>
        {else}
        <div class="dz-item-group">
            <span class="dz-intro">
                <sup>*</sup>{lang phone_auth:phone}:</span>
            <div class="phonenumber">
                <div class="area-code btn-group dropdown">
                    <div class="country-code active">
                        <span class="add">+</span>
                        <input type="text" class="form-control dz-input" value="86" name="country_code">
                    </div>
                    <button class="btn dropdown-toggle-split dropdown-toggle btn-down" type="button">
                        <img src="{$static_path}/img/dropdown.png" />
                    </button>
                    <ul class="dropdown-menu" style="display: none">
                        <li role="menuitem">
                            <a class="dropdown-item">
                                CN +86
                            </a>
                        </li>
                        <li role="menuitem">
                            <a class="dropdown-item">
                                TW +886
                            </a>
                        </li>
                        <li role="menuitem">
                            <a class="dropdown-item">
                                HK +852
                            </a>
                        </li>
                        <li role="menuitem">
                            <a class="dropdown-item">
                                USA +1
                            </a>
                        </li>
                        <li role="menuitem">
                            <a class="dropdown-item">
                                JP +81
                            </a>
                        </li>
                        <li role="menuitem">
                            <a class="dropdown-item">
                                KP +850
                            </a>
                        </li>
                    </ul>
                </div>
                <input maxlength="11"  autocomplete="off"  class="form-control bg-c dz-input" type="tel" name="phone">
                <span class="dz-title"></span>
            </div>
        </div>
        {/if}
        <div class="dz-item-group none dz-code-group">
            <span class="dz-intro"><sup>*</sup>{lang phone_auth:code}:</span>
            <input class="form-control dz-input dz-input-code" placeholder="{lang phone_auth:code_pl}" type="text" name="code"/>
            <button class="btn dz-btn dz-btn-code">{lang phone_auth:send_code}</button>
        </div>
        <div class="dz-item-group">
            <span class="dz-intro"><sup>*</sup>{lang phone_auth:vaptcha}:</span>
            <div class="vaptcha_container">
                <div class="vaptcha-init-main">
                    <div class="vaptcha-init-loading">
                        <a><img src="https://cdn.vaptcha.com/vaptcha-loading.gif"/></a>
                        <span class="vaptcha-text"><a href="https://www.vaptcha.com/" title="{lang phone_auth:captcha}" target="_blank">{lang phone_auth:captcha}</a>{lang phone_auth:captcha_loading}</span>
                    </div>
                </div>
            </div>
            <span class="dz-title error"></span>
        </div>
        <div class="v-line"></div>
        <!--{if $setting['bbrules']}-->
        <div class="dz-item-group clearfix">
            <span class="dz-intro"></span>
            <input type="checkbox" class='checkbox' name="agreebbrule" value="$bbrulehash" checked id="agreebbrule">
            <label for="agreebbrule" class="dz-item-text">{lang phone_auth:agree}<a class="dz-link protocal-link" href="javascript:;">{lang phone_auth:rulemessage}</a></label>
        </div>
        <!--{/if}-->
        <div class="dz-item-group  clearfix">
            <span class="dz-intro"></span>
            <button class="btn dz-btn" id="register_btn" disabled>{lang phone_auth:register}</button>
        </div>
    </div>
    <div class="vaptcha-tip-cont none">
        <div class="vaptcha-dz-tip vaptcha-tip-warn none">
            <img class="dz-tip-icon" src="{$static_path}/img/vaptcha-dz-warning.png"/>
            <span class="dz-tip-text"></span>
        </div>
        <div class="vaptcha-dz-tip vaptcha-tip-success none">
            <img class="dz-tip-icon" src="{$static_path}/img/vaptcha-dz-success.png"/>
            <span class="dz-tip-text"></span>
        </div>
    </div>
</div>
<script src="{$static_path}/js/v-helper.min.js?v=$params['version']" async></script>
<script>
    (function register_run() {
        if(window.v_helper) {
            new v_helper({
                'vid': "$params['vid']",
                'vaptcha_color': '#{$params["style_color"]}',
                'vaptcha_style': '{$params["btn_style"]}',
                'site_url': '{$site_url}',
                lang: {
                    send_code: '{lang phone_auth:send_code}'
                }
            }).register_run({
                id: '$id',
                has_email: {$params["register_email"]},
                has_qq: 0,
                has_bbrules: {$setting['bbrules']},
                enable_inter: {$params["enable_inter"]},
                username: 'username',
                email: 'email',
                password: 'password',
                lang: {
                    username: '{lang phone_auth:username_rule}',
                    email: '{lang phone_auth:email_rule}',
                    email_error: '{lang phone_auth:email_error}',
                    qq_error: '{lang phone_auth:qq_error}',
                    password: '{lang phone_auth:password_not_match}',
                    phone: '{lang phone_auth:phone_error}',
                    code: '{lang phone_auth:send_code}'
                }
            });
        } else {
            setTimeout(register_run);
        }
    })()
</script>
{/if}
<!--{/block}-->
{eval return $return;}
{eval }
}
